package com.gt.xmall.service;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;


import com.gt.xmall.service.BaseService;

import com.gt.xmall.model.GtdCollection;
import com.gt.xmall.repository.GtdCollectionDao;



@Component
@Transactional(readOnly = true)
public class GtdCollectionService extends BaseService{
	@Autowired
	private GtdCollectionDao gtdCollectionDao;
	
	public List<GtdCollection> getGtdCollections(){
		return (List<GtdCollection>)gtdCollectionDao.findAll();
	}
	
	public GtdCollection getGtdCollection(Long id){
		return gtdCollectionDao.findOne(id);
	}
	@Transactional(readOnly = false)
	public GtdCollection saveGtdCollection(GtdCollection gtdCollection){
		return gtdCollectionDao.save(gtdCollection);
	}
	
	@Transactional(readOnly = false)
	public void deleteGtdCollection(Long id){
		 gtdCollectionDao.delete(id);
	}
	
}